package com.stgy.lease.web.api.config;

import com.stgy.lease.web.api.interceptor.StgyAuthInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * ClassName:StgyWebMvcConfigurer
 * Package:com.stgy.lease.web.api.config
 * Description:
 *
 * @Author:helei
 * @Create:2024/9/6 - 10:02
 */
@Configuration
public class StgyWebMvcConfigurer implements WebMvcConfigurer {

    @Autowired
    private StgyAuthInterceptor stgyAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(stgyAuthInterceptor)
                .addPathPatterns("/app/**")
                .excludePathPatterns("/app/login/**");
    }
}
